package com.yunji.aggregate.mapper;

import com.yunji.aggregate.model.dto.base.BelongStockParam;
import com.yunji.aggregate.model.dto.stock.*;
import com.yunji.aggregate.model.vo.base.BelongStockStatisticsVO;
import com.yunji.aggregate.model.vo.stock.*;
import com.yunji.common.annotation.DataScope;
import com.yunji.common.constant.PermissionTypeConstant;

import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/12/7 14:22
 * @description : TODO
 **/
public interface IStockAggregateMapper {
    List<BelongStockStatisticsVO> belongStockList(BelongStockParam param);

    //FIXME 去除belong
    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<StockStatisticsVO> searchStockList(StockParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_STORAGE_THREE, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<AllocateTicketStatisticsVO> searchAllocateList(AllocateTicketParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_STORAGE_TWO, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<DiscardTicketStatisticsVO> searchDiscardList(DiscardTicketParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_STORAGE_THREE, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<RepairTicketStatisticsVO> searchRepairList(RepairTicketParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_BELONG, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<StockTakeStatisticsVO> searchStockTakeList(StockTakeParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_BELONG, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true, excludeTables = "v3_express")
    List<StorageTicketStatisticsVO> searchStorageTicketList(StorageTicketParam param);

    @DataScope(value = {PermissionTypeConstant.DATA_SCOPE_BELONG, PermissionTypeConstant.DATA_SCOPE_BELONG_IDS}, hasParam = true)
    List<StorageRecordsStatisticsVO> searchRecordsList(StorageRecordsParam param);

    List<String> searchStockTableField(StockParam param);

    List<String> searchStorageRecordsTableField(StorageRecordsParam param);

}
